package QC.MessageBox.beans;

import QC.MessageBox.annotation.APPTable;
import io.vertx.core.json.JsonObject;

/**
 * Created by Andaren on 2017/4/11.
 * Used for: 消息客服实体类
 */
@APPTable(table = "t_cus_serv")
public class CustomerServ {

    @APPTable(column = "id", isId = true)
    private Long id;        // 客服表主键
    @APPTable(column = "talkid")
    private String talkId;  // app接入客服的talkId

    private String publicName;
    private String headUrl;

    //
    private String openid;

    private String flag;    // 客服启用状态

    public CustomerServ () {}

    public CustomerServ (String json) {
        JsonObject jsonObject = new JsonObject(json);
        this.id = jsonObject.getLong("id");
        this.talkId = jsonObject.getString("talkId");
        this.flag = jsonObject.getString("flag");
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTalkId() {
        return talkId;
    }

    public void setTalkId(String talkId) {
        this.talkId = talkId;
    }

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("CustomerServ{");
        sb.append("id=").append(id);
        sb.append(", talkId='").append(talkId).append('\'');
        sb.append(", flag='").append(flag).append('\'');
        sb.append('}');
        return sb.toString();
    }
}
